<template>
  <div>
    <div style="margin: 1vw 0 0">创建任务</div>
    <div style="margin: 0.5vw 0 0">
      <el-button type="primary" size="small" @click="adds">主要按钮</el-button>
    </div>
    <taskdialog ref="taskdialog" />
  </div>
</template>

<script>
import taskdialog from "./taskdialog.vue";
export default {
  components: {
    taskdialog,
  },
  methods: {
    adds() {
      this.$refs.taskdialog.dialogVisible = true;
      this.$nextTick(() => {
        this.$refs.taskdialog.title = "新增任务";
        this.searchUps();
      });
    },
    //查询下属
    searchUps() {
      this.$http
        .get("/searchUp", {
          params: { dept: this.$store.state.user.info.dept },
        })
        .then((res) => {
          if (res.code == 200) {
            this.$refs.taskdialog.$refs.taskform.options = res.data.data;
          }
        });
    },
  },
};
</script>

<style>
</style>